/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Model
*        文件名:             BaseParameterEntity.cs
*        创建系统时间:       2012/11/2 19:07:03
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Model
{
    using System;
    using System.Data;
    using ECP.Utilities;

    [Serializable]
    public class BaseParameterEntity
    {
        private string categoryID = string.Empty;
        private string createDate = string.Empty;
        private string createUserID = string.Empty;
        private string description = string.Empty;
        private bool enabled;
        private string id = string.Empty;
        private string modifyDate = string.Empty;
        private string modifyUserID = string.Empty;
        private string parameterCode = string.Empty;
        private string parameterContent = string.Empty;
        private string parameterID = string.Empty;
        private string sortCode = string.Empty;
        private bool worked;

        public void ClearProperty(BaseParameterEntity ParameterEntity)
        {
            ParameterEntity.ID = string.Empty;
            ParameterEntity.CategoryID = string.Empty;
            ParameterEntity.ParameterID = string.Empty;
            ParameterEntity.ParameterCode = string.Empty;
            ParameterEntity.ParameterContent = string.Empty;
            ParameterEntity.Worked = false;
            ParameterEntity.Enabled = false;
            ParameterEntity.SortCode = string.Empty;
            ParameterEntity.Description = string.Empty;
            ParameterEntity.CreateUserID = string.Empty;
            ParameterEntity.CreateDate = string.Empty;
            ParameterEntity.ModifyUserID = string.Empty;
            ParameterEntity.ModifyDate = string.Empty;
        }

        public BaseParameterEntity GetFrom(DataRow dataRow)
        {
            this.ID = BaseBusinessLogic.ConvertToString(dataRow[BaseParameterTable.FieldID]);
            this.CategoryID = BaseBusinessLogic.ConvertToString(dataRow[BaseParameterTable.FieldCategoryID]);
            this.ParameterID = BaseBusinessLogic.ConvertToString(dataRow[BaseParameterTable.FieldParameterID]);
            this.ParameterCode = BaseBusinessLogic.ConvertToString(dataRow[BaseParameterTable.FieldParameterCode]);
            this.ParameterContent = BaseBusinessLogic.ConvertToString(dataRow[BaseParameterTable.FieldParameterContent]);
            this.Worked = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseParameterTable.FieldWorked]);
            this.Enabled = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseParameterTable.FieldEnabled]);
            this.SortCode = BaseBusinessLogic.ConvertToString(dataRow[BaseParameterTable.FieldSortCode]);
            this.Description = BaseBusinessLogic.ConvertToString(dataRow[BaseParameterTable.FieldDescription]);
            this.CreateUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseParameterTable.FieldCreateUserID]);
            this.CreateDate = BaseBusinessLogic.ConvertToString(dataRow[BaseParameterTable.FieldCreateDate]);
            this.ModifyUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseParameterTable.FieldModifyUserID]);
            this.ModifyDate = BaseBusinessLogic.ConvertToString(dataRow[BaseParameterTable.FieldModifyDate]);
            return this;
        }

        public BaseParameterEntity GetFrom(DataTable dataTable)
        {
            foreach (DataRow row in dataTable.Rows)
            {
                this.GetFrom(row);
                break;
            }
            return this;
        }

        public string CategoryID
        {
            get
            {
                return this.categoryID;
            }
            set
            {
                this.categoryID = value;
            }
        }

        public string CreateDate
        {
            get
            {
                return this.createDate;
            }
            set
            {
                this.createDate = value;
            }
        }

        public string CreateUserID
        {
            get
            {
                return this.createUserID;
            }
            set
            {
                this.createUserID = value;
            }
        }

        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                this.description = value;
            }
        }

        public bool Enabled
        {
            get
            {
                return this.enabled;
            }
            set
            {
                this.enabled = value;
            }
        }

        public string ID
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        public string ModifyDate
        {
            get
            {
                return this.modifyDate;
            }
            set
            {
                this.modifyDate = value;
            }
        }

        public string ModifyUserID
        {
            get
            {
                return this.modifyUserID;
            }
            set
            {
                this.modifyUserID = value;
            }
        }

        public string ParameterCode
        {
            get
            {
                return this.parameterCode;
            }
            set
            {
                this.parameterCode = value;
            }
        }

        public string ParameterContent
        {
            get
            {
                return this.parameterContent;
            }
            set
            {
                this.parameterContent = value;
            }
        }

        public string ParameterID
        {
            get
            {
                return this.parameterID;
            }
            set
            {
                this.parameterID = value;
            }
        }

        public string SortCode
        {
            get
            {
                return this.sortCode;
            }
            set
            {
                this.sortCode = value;
            }
        }

        public bool Worked
        {
            get
            {
                return this.worked;
            }
            set
            {
                this.worked = value;
            }
        }
    }
}